package com.xyw.his00.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xyw.his00.dto.PayDTO;
import com.xyw.his00.pojo.dbpojo.CheckRequest;
import com.xyw.his00.vo.C_pay;
import com.xyw.his00.vo.PatientCheck;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;
@Transactional
@Mapper
public interface CheckRequestMapper extends BaseMapper<CheckRequest> {

    public List<PayDTO> selectPayInfo(int registerId) ;

    //搜索未交费的检查缴费项目
    //todo:@Param注解的特点
    List<C_pay> selectChecksNotPay(@Param("checkState") String checkState, @Param("registerId") int registerId);



    //todo:搜索患者的检查项目信息
    List<PatientCheck> selectPatientCheck(int registerId);
    List<PatientCheck> selectPatientCheckByDoctorId(int doctorId);

    PatientCheck selectPatientCheckByTwo(int registerId, int medicalTechnologyId);
    @Update("UPDATE check_request SET check_result=#{checkResult}, inputcheck_employee_id=#{inputCheckEmployeeId}, " +
            "check_time=#{checkTime},check_state='已出结果' " +
            "WHERE register_id=#{registerId} " +
            "AND medical_technology_id=#{medicalTechnologyId}")
    int updateCheckRequest(String checkResult, int inputCheckEmployeeId,
                           LocalDateTime checkTime, int registerId, int medicalTechnologyId);
}
